home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1027 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.8 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: Rich Paul <rpaul@trcinc.com>
  3. Newsgroups: comp.std.c++
  4. Subject: Re: static members as members of a metaclass h
  5. Date: 10 Apr 1996 14:56:46 GMT
  6. Organization: Technical Resource Connection
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <316BC211.1B39@trcinc.com>
  9. References: <4jc5lt$doh@arl-news-svc-2.compuserve.com>
  10.         <4jckdc$ad6@engnews1.Eng.Sun.COM> <kywx3q1nox.fsf@gator.mit.edu>
  11. NNTP-Posting-Host: taumet.eng.sun.com
  12. Mime-Version: 1.0
  13. Content-Type: text/plain; charset="us-ascii"
  14. Content-Transfer-Encoding: 7bit
  15. X-Nntp-Posting-Host: bajor-le1.trcinc.com
  16. X-Mailer: Mozilla 2.01Gold (WinNT; I)
  17. X-Lines: 22
  18. Content-Length: 735
  19. Originator: clamage@taumet
  20.  
  21. Jeffrey C. Gealow wrote:
  22. > In article <4jckdc$ad6@engnews1.Eng.Sun.COM> clamage@Eng.Sun.COM
  23. > (Steve Clamage) writes:
  24. >    I believe a reasonable solution to the problem of initialization of
  25. >    non-local static data is not to use non-local static data!
  26. >    Instead of a static data object or static class data member, use a
  27. >    function with a local static object.
  28. > But this adds the overhead of the function call mechanism to every use
  29. > of the object.
  30.  
  31. If you inline the function, are you guarenteed a 
  32. single instance, or might there be one in each 
  33. compilation unit, or in each invocation of the 
  34. function?
  35.  
  36. If it's safe, inlining the function would get rid 
  37. of the overhead, but I'm not sure of the safety ...
  38.  
  39.  
  40. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  41. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  42. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  43. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  44. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  45.